package com.aidex.biz.service.impl;

import java.util.List;
import com.aidex.common.annotation.DataScope;
import com.github.pagehelper.PageInfo;
import com.aidex.common.core.domain.entity.SysUser;
import com.aidex.common.core.domain.entity.SysDept;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.framework.cache.DeptUtils;
import com.aidex.framework.cache.UserUtils;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.aidex.biz.mapper.SmsLogMapper;
import com.aidex.biz.domain.SmsLog;
import com.aidex.biz.service.SmsLogService;
import org.springframework.transaction.annotation.Transactional;
import com.aidex.common.utils.NumberUtils;

/**
 * 短信记录Service业务层处理
 * @author sean
 * @email 2074844820@qq.com
 * @date 2023-04-26
 */
@Service
@Transactional(readOnly = true)
public class SmsLogServiceImpl extends BaseServiceImpl<SmsLogMapper, SmsLog> implements SmsLogService
{
    private static final Logger log = LoggerFactory.getLogger(SmsLogServiceImpl.class);

    /**
     * 获取单条数据
     * @param smsLog 短信记录
     * @return 短信记录
     */
    @Override
    public SmsLog get(SmsLog smsLog)
    {
        SmsLog dto = super.get(smsLog);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 短信记录id
     * @return 短信记录
     */
    @Override
    public SmsLog get(String id)
    {
        SmsLog dto = super.get(id);
        return dto;
    }


    /**
     * 查询短信记录列表
     * @param smsLog 短信记录
     * @return 短信记录
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public List<SmsLog> findList(SmsLog smsLog)
    {
        return super.findList(smsLog);
    }

    /**
     * 分页查询短信记录列表
     * @param smsLog 短信记录
     * @return 短信记录
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public PageInfo<SmsLog> findPage(SmsLog smsLog)
    {
        return super.findPage(smsLog);
    }

    /**
     * 保存短信记录
     * @param smsLog
     * @return 结果
     */
    @Override
    public boolean save(SmsLog smsLog)
    {
        return super.save(smsLog);
    }


    /**
     * 删除短信记录信息
     * @param smsLog
     * @return 结果
     */
    @Override
    public boolean remove(SmsLog smsLog)
    {
        return super.remove(smsLog);
    }

    /**
     * 批量删除短信记录
     * @param ids 需要删除的短信记录ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteSmsLogByIds(String[] ids)
    {
        return mapper.deleteSmsLogByIds(ids);
    }

    /**
     * 获取最大编号
     * @param smsLog 短信记录
     * @return 结果
     */
    @Override
    public int findMaxSort(SmsLog smsLog)
    {
        return NumberUtils.nextOrder(mapper.findMaxSort(smsLog));
    }
}
